import type {RouteRecordRaw} from "vue-router";
import {
    DashboardOutlined,
    FundOutlined,
    ScheduleOutlined,
    ProjectOutlined, ContainerOutlined, PayCircleOutlined, ExperimentOutlined, IdcardOutlined, SettingOutlined
} from "@ant-design/icons-vue";
import admin from "@/router/modules/admin.ts";

export default [
    {
        path: '/dashboard',
        name: 'Workbench',
        component: () => import('@/views/dashboard/index.vue'),
        meta: {
            title: '工作台',
            icon: DashboardOutlined,
            requiresAuth: true,
            permission: 'dashboard'
        }
    },
    {
        path: '/dashboard/overview',
        name: 'Overview',
        component: () => import('@/views/dashboard/overview.vue'),
        meta: {
            title: '数据分析',
            icon: FundOutlined,
            requiresAuth: true,
            permission: 'overview'
        }
    },
    {
        path: '/task',
        name: 'Task',
        component: () => import('@/views/task/index.vue'),
        meta: {
            title: '任务管理',
            icon: ScheduleOutlined,
            requiresAuth: true,
            permission: 'task',
            actions: ['task:create', 'task:update', 'task:delete']
        }
    },
    {
        path: '/project',
        name: 'Project',
        component: () => import('@/views/project/index.vue'),
        meta: {
            title: '项目管理',
            icon: ProjectOutlined,
            requiresAuth: true,
            permission: 'project',
            actions: ['project:create', 'project:update', 'project:delete']
        }
    },
    {
        path: '/order',
        name: 'Order',
        component: () => import('@/views/order/index.vue'),
        meta: {
            title: '订单管理',
            icon: ContainerOutlined,
            requiresAuth: true,
            permission: 'order',
            actions: ['order:create', 'order:update', 'order:delete']
        }
    },
    //财务管理
     {
         path: '/finance',
          name: 'Finance',
          component: () => import('@/views/finance/index.vue'),
          meta: {
              title: '财务管理',
              icon: PayCircleOutlined,
              requiresAuth: true,
              permission: 'finance',
              actions: ['finance:create', 'finance:update', 'finance:delete']
          }
     },
    {
        path: '/product',
        name: 'Product',
        component: () => import('@/views/product/index.vue'),
        meta: {
            title: '产品管理',
            icon: ExperimentOutlined,
            requiresAuth: true,
            permission: 'product',
            actions: ['product:create', 'product:update', 'product:delete']
        }
    },
    {
        path: '/customer',
        name: 'Customer',
        component: () => import('@/views/customer/index.vue'),
        meta: {
            title: '客户关系',
            icon: IdcardOutlined,
            requiresAuth: true,
            permission: 'customer',
            actions: ['customer:create', 'customer:update', 'customer:delete']
        }
    },
    {
        path: '/admin',
        name: 'Admin',
        component: () => import('@/layout/admin.vue'),
        meta: {
            title: '系统配置',
            icon: SettingOutlined,
            hiddenChildren:true,
            requiresAuth: true
        },
        children: admin
    }
] as RouteRecordRaw[]